package dang.action.main;

import java.util.List;

import dang.action.DangAction;
import dang.dao.CategoryDao;
import dang.dao.DaoFactory;
import dang.entity.Category;
import dang.exception.DangException;

public class CategoryAction extends DangAction{
	private List<Category> cats;

	public String execute(){
		CategoryDao dao = DaoFactory.getCategoryDao();
		try {
			cats=dao.findAll();
			return "success";
		} catch (DangException e) {
			e.printStackTrace();
			return "error";
		}
	}
	
	public List<Category> getCats() {
		return cats;
	}

	public void setCats(List<Category> cats) {
		this.cats = cats;
	}
}
